- renderer = g.renderer
- unless g.display_type == "hidden"
  = f.inputs "#{next_question_number(g)}#{g.text_for(@render_context, I18n.locale)}", :id => "g_#{g.id}", :class => "g_#{renderer} #{g.css_class(@response_set)}" do
    %li.help= g.help_text_for(@render_context, I18n.locale)
    - case renderer
      - when :grid
        %li
          %table
            %col.pre
            - qs.first.answers.each do |a|
              %col{:class => cycle("odd", "even")}
            %col.post
            %tbody
              - qs.each_slice(10) do |ten_questions| # header row every 10
                %tr
                  %th &nbsp;
                  - ten_questions.first.answers.each do |a|
                    %th
                      = a.text_for(nil, @render_context, I18n.locale)
                      %span.help= a.help_text_for(@render_context, I18n.locale)
                  %th &nbsp;
                - ten_questions.each_with_index do |q, i|
                  %tr{:id => "q_#{q.id}", :class => "q_#{renderer} #{q.css_class(@response_set)}"}
                    %th
                      = q.text_for(:pre, @render_context, I18n.locale)
                      = q.help_text_for(@render_context, I18n.locale)
                      - if q.pick == "one"
                        - r = response_for(@response_set, q, nil, g)
                        - i = response_idx  # increment the response index since the answer partial skips for q.pick == one
                        = f.semantic_fields_for i, r do |ff|
                          = ff.input :question_id, :as => :quiet
                          = ff.input :api_id, :as => :quiet
                      - q.answers.each do |a|
                        %td= render(a.custom_renderer || '/partials/answer', :g => g, :q => q, :a => a, :f => f) unless q.display_type == "label"
                      %th= q.text_for(:post, @render_context, I18n.locale)
      - when :repeater
        - (@response_set.count_group_responses(qs) + 1).times do |rg|
          %li
            - qs.each do |q|
              = render q.custom_renderer || "/partials/question", :g => g, :rg => rg, :q => q, :f => f
        = submit_tag("+ add row", :name => "section[#{@section.id}][g_#{g.id}]", :class => "add_row")
      - else # :inline
        - qs.each do |q|
          = render q.custom_renderer || "/partials/question", :g => g, :q => q, :f => f
